package com.zl.rbac.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zl.rbac.entity.Permission;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Set;

/**
 * 权限的Mapper类
 * @InterfaceName: PermissionMapper
 * @author: suke
 * @since: 2021/1/11 14:02
 */
@Mapper
@Repository
public interface PermissionMapper extends BaseMapper<Permission>{

    /**
     *
     * @Title: 根据角色id查询该角色的拥有的权限
     * @param roleId: 角色id
     * @return java.util.List<com.zl.rbac.entity.Permission>
     * @author: suke
     * @since: 2021/1/12 10:58
     */
    public List<Permission> queryByRoleId(Integer roleId) throws Exception;

    /**
     * 
     * @Title: 根据用户id查询该用户拥有的所有权限表达式
     * @param id  用户id
     * @return java.util.Set<java.lang.String>
     * @author: suke
     * @since: 2021/1/14 9:38
     */
    public Set<String> queryExpressionSetByUserId(Integer id)throws Exception;
}
